home *** CD-ROM | disk | FTP | other *** search
/ BBS in a Box 7 / BBS in a Box - Macintosh - Volume VII (BBS in a Box) (January 1993).iso / Files / Prog / M / MacsBug Help.cpt / MacsBug Help (TeachText) next >
Text File  |  1991-11-04  |  13KB  |  347 lines

  1. MacsBug 6.2
  2.  
  3. Online Help Listing
  4.  
  5.  
  6.  
  7. Table of Contents
  8.  
  9.     Editing    1
  10.     Selecting procedure names    1
  11.     Expressions    1
  12.     Values    2
  13.     Operators    2
  14.     Flow control    2
  15.     Breakpoints    3
  16.     A-Traps    3
  17.     Disassembly    4
  18.     Heaps    4
  19.     Symbols    4
  20.     Stack    5
  21.     Memory    5
  22.     Registers    5
  23.     Macros    6
  24.     Miscellaneous    6
  25.  
  26.  
  27.  
  28. Editing
  29.  Type a command and then press Return or Enter to execute it. Pressing
  30.  Return without entering a command repeats the last command. You can
  31.  enter more than one command on the command line by separating
  32.  commands with a semicolon (;).
  33.  
  34.  
  35. Editing commands
  36.   Command-V            Scroll command buffer down and copy command
  37.                               line to current command line.
  38.   Command-B            Scroll command buffer up and copy command
  39.                               line to current command line.
  40.   Option-Left Arrow    Move cursor left one word.
  41.   Option-Right Arrow   Move cursor right one word.
  42.   Option-Delete        Delete the word to the left of the cursor.
  43.   Command-Left Arrow   Move cursor to beginning of command line.
  44.   Command-Right Arrow  Move cursor to end of command line.
  45.   Command-Delete       Delete the line to the left of the cursor.
  46.  
  47. Selecting procedure names
  48.  Display a list of procedure names by typing Command-: or Command-D.
  49.  Select a procedure from the list by using the up and down arrows.
  50.  Copy the selected procedure name to the insertion point of the
  51.  command line by pressing Return. Press Escape to leave command line
  52.  unchanged. Display a selected (qualified) list of procedure names by
  53.  typing the first letter(s) of the procedure name (after displaying
  54.  the list with Command-: or Command-D). Pressing Delete undoes the
  55.  qualification one letter at a time. Entering Command-: or Command-D
  56.  undoes the qualification and shows all procedure names. With C++ and
  57.  Object Pascal names you may use the Tab key to qualify the class.
  58.  
  59. Expressions
  60.  The general form of an expression is: value1 [operator value2].
  61.  Use parentheses to control the order of evaluation.
  62.  Expressions always evaluate to a 32 bit value unless .W or .B
  63.  follows the value. Expressions evaluate to either a numeric or a
  64.  boolean value based on the operators used. The action of some
  65.  commands change based on this result. For instance, BR addr expr
  66.  will break each n times if expression is numeric or it will break
  67.  when expr is true if expression is boolean.
  68.  
  69.  Values
  70.    Registers   All 68000 family registers use their Motorola names.
  71.                  MMU 64 bit registers and floating point registers
  72.                  are not allowed in expressions.
  73.    Numbers     Numbers are hex by default but can be preceded by a '$'
  74.                  in the case of conflicts with registers An and Dn.
  75.                  Numbers are decimal if they are preceded by a '#'.
  76.    Symbols     Symbols are found by searching the heap and evaluate 
  77.                  to an address.
  78.    Traps       Trap number in the range A000 to ABFF or a trap name.
  79.                  Trap names can be preceded by a '†' in the case of
  80.                  conflicts with symbol names.
  81.    '.'         The last address referenced by certain commands. For
  82.                  instance SM sets dot to the first address that was
  83.                  changed and sets the last command to DM. Typing
  84.                  return will display the memory that was changed.
  85.    ':'         The address of the start of the proc shown in the PC
  86.                  window. Not valid if no proc name exists for PC.
  87.  
  88. Operators
  89.    Arithmetic    +   -   *   /   MOD
  90.    Boolean       AND or &   OR or |   NOT or !   XOR
  91.    Equality      = or ==   <> or !=   <   >   <=   >=
  92.    Indirection   @ (prefix) or ^ (postfix)
  93.  
  94. Flow control
  95.  G [addr]
  96.     Resume execution at addr or PC if no addr. Command-G is the same
  97.     as entering G and pressing Return.
  98.  GT addr [';cmds']
  99.     Go till addr is reached and optionally execute one or more
  100.     commands. The addr can be in ROM but execution will be much
  101.     slower.
  102.  S  [n | expr]
  103.     Step n instructions or until expr is true. Command-S is the same
  104.     as entering S and pressing Return.
  105.  SO [n | expr]
  106.     Step n instructions or until expr is true. JSRs, BSRs and Traps
  107.     are treated as one instruction. For historical reasons, T (for
  108.     Trace) is allowed as an alias for SO. Command-T is the same as
  109.     entering T and pressing Return. If n is zero then clear all step
  110.     points.
  111.  SS addr [addr]
  112.     Step until checksum of addr range changes. If you do not specify
  113.     a range, step until long word at addr changes.
  114.  MR [offset | addr]
  115.     Break after the current procedure returns by replacing its return
  116.     address. If the parameter is less than A6 then the return address
  117.     is at A7+offset. If the parameter is greater than or equal to A6
  118.     then the return address is at addr+4. If no parameter then the
  119.     return address is at A7.
  120.  
  121.  Breakpoints
  122.  BR addr [n | expr] [';cmds']
  123.     Break at addr each n times or when expr is true and optionally
  124.     execute one or more commands. If no n or expr then break always.
  125.     The addr can be in ROM but execution will be much slower.
  126.  BRM string
  127.     Set breakpoints at all procedure names that contain string.
  128.     String can occur anywhere in the name, not just at the beginning.
  129.  BRC [addr]
  130.     Clear breakpoint at addr or all breakpoints if no addr.
  131.  BRD
  132.     Display breakpoint table.
  133.  
  134. A-Traps
  135.  Appending A to an A-Trap command name specifies that the command
  136.  applies only to A-Traps that are called from the application heap.
  137.  Entering two traps as parameters defines a trap range. Entering no
  138.    traps defines the range A000 to ABFF.
  139.  
  140.  ATB[A] [trap [trap]] [n | expr] [';cmds']
  141.     Break at traps each n times or when expr is true and optionally
  142.     execute one or more commands. If no n or expr then break always.
  143.  ATT[A] [trap [trap]] [n | expr]
  144.     Display trap information each time a specified trap is called.
  145.  ATHC[A] [trap [trap]] [n | expr]
  146.     Check the heap each time a specified trap is called.
  147.  ATSS[A] [trap [trap]] [n | expr], addr [addr]
  148.     Checksum addr range each time a specified trap is called. If the
  149.     checksum has changed then break into MacsBug. If no second addr
  150.     then checksum the long word at addr.
  151.  ATC [trap [trap]]
  152.     Clear trap range or all traps if no parameters.
  153.  ATD
  154.     Display the A-Trap tables.
  155.  ATR[A] [ON | OFF]
  156.     Turns trap recording on or off. Toggle if no parameters.
  157.     Information about the most recent trap calls is recorded.
  158.  ATP
  159.     Plays back the information recorded while ATR is on.
  160.  DSC[A] [ON | OFF | str]
  161.     Turns Discipline on or off. Toggle if no parameter. Any parameters
  162.     other than ON or OFF are passed to Discipline for interpretation.
  163.     Discipline examines parameters before trap calls and examines
  164.     results after trap calls. Any errors break into MacsBug.
  165.  DSCX [OFF | ON]
  166.     Turn discipline breaks on or off. Default ON.
  167.  
  168.  Disassembly
  169.  All commands assume the PC if no addr is specified.
  170.  
  171.  IL [addr [n]]
  172.     Disassemble n lines from addr. If no n then display half page.
  173.  IP [addr]
  174.     Disassemble half page centered around addr.
  175.  ID [addr]
  176.     Disassemble 1 line starting at addr.
  177.  IR [addr]
  178.     Disassemble till the end of the routine addr is in.
  179.  DH expr ...
  180.     Disassemble one or more exprs as a sequence of 16 bit opcodes.
  181.  
  182. Heaps
  183.  HX [addr]
  184.     Set the current heap to the heap at addr. If no parameter then
  185.     toggle between the Application, System and user heaps.
  186.  HZ [addr]
  187.     List all known heap zones. If parameter then list all heap zones
  188.     embedded into the heap at addr.
  189.  HD [F | N | R | L | P | Q | RS | TYPE]
  190.     Display specific blocks in the current heap or all blocks if no
  191.     parameter. The possible qualifiers are
  192.        F:    Free blocks
  193.        N:    Nonrelocatable blocks
  194.        R:    Relocatable blocks
  195.        L:    Locked blocks
  196.        P:    Purgeable blocks
  197.        Q:    Questionable blocks
  198.        RS:   Resource blocks
  199.        TYPE: Resource blocks of this type
  200.  HT
  201.     Display a summary of the current heap.
  202.  HC
  203.     Check the current heap for inconsistencies.
  204.  HS [addr]
  205.     Turn on scrambling of the heap at addr or ApplZone if no addr.
  206.     Calling NewPtr, NewHandle, ReallocHandle, SetPtrSize or
  207.     SetHandleSize checks the heap before the call. If good then the
  208.     heap is scrambled. If bad then a MacsBug break is forced.
  209.     Scrambling continues until next HS or a bad heap is detected.
  210.  
  211. Symbols
  212.  RN [expr]
  213.     Set the resource file ref num qualifier to expr. If no expr then
  214.     set it to curMap. Once set, all subsequent symbol references must
  215.     be from a heap block with a matching file ref num. If expr is 0
  216.     then all symbols match.
  217.  SD
  218.     Command-: or Command-D is now used to select symbol names.
  219.  SX [ON | OFF]
  220.     Turn symbols in disassembly on or off. Toggle if no parameter.
  221.  
  222.  Stack
  223.  SC6 [addr [nbytes]]
  224.     Show the calling chain based on A6 links. If no addr then the
  225.     chain starts with A6. If addr then the chain starts at addr. If no
  226.     nbytes then the stack base is CurStackBase. If nbytes then the
  227.     stack base is addr+nbytes.
  228.  SC7 [addr [nbytes]]
  229.     Show possible return addresses on the stack. A return address is
  230.     an even address that points after a JSR, BSR or A-Trap. If no addr
  231.     then A7 is the stack pointer. If addr then addr is the stack
  232.     pointer. If no nbytes then the stack base is CurStackBase. If
  233.     nbytes then the stack base is addr+nbytes.
  234.  
  235. Memory
  236.  All commands assume the dot address if no addr is specified.
  237.  
  238.  DM [addr [n | template | basic type]]
  239.     Display memory from addr for n bytes or as defined by a template
  240.     or a basic type. The basic types are Byte, Word, Long, SignedByte,
  241.     SignedWord, SignedLong, UnsignedByte, UnsignedWord, UnsignedLong,
  242.     PString and CString.
  243.  TMP [name]
  244.     List templates names that match name. If no name then list all
  245.     template names.
  246.  DP [addr]
  247.     Display memory from addr for 128 bytes.
  248.  DB [addr]
  249.     Display the byte at addr.
  250.  DW [addr]
  251.     Display the word at addr.
  252.  DL [addr]
  253.     Display the long at addr.
  254.  SM addr expr | 'string' ...
  255.     Assign values to memory starting at addr. Each value determines
  256.     the assigment size. Specific sizes can be set using SB, SW or SL.
  257.  SB addr expr | 'string' ...
  258.     Assign values to bytes starting at addr.
  259.  SW addr expr | 'string' ...
  260.     Assign values to words starting at addr.
  261.  SL addr expr | 'string' ...
  262.     Assign values to longs starting at addr.
  263.  
  264. Registers
  265.  Values can be assigned to registers with commands of the form:
  266.    RegisterName := expression  or  RegisterName = expression
  267.  
  268.  TD
  269.     Display CPU registers.
  270.  TF
  271.     Display 68881 floating point registers.
  272.  TM
  273.     Display 68851 MMU registers.
  274.  RAD
  275.     Toggle between specifying registers as RAn or RDn and specifying
  276.     registers as An or Dn. The default setting does not require the R.
  277.  
  278.  Macros
  279.  MC name 'expr' | expr
  280.     Define a macro called name that expands to 'expr' or to the
  281.     current value of expr.
  282.  MCC [name]
  283.     Clear named macro or all macros if no name.
  284.  MCD [name]
  285.     List macros that match name. If no name then list all macros.
  286.  
  287. Miscellaneous
  288.  Escape or tilde
  289.     Toggle between the user screen and the MacsBug screen.
  290.  RB
  291.     Unmount the boot volume and reboot.
  292.  RS
  293.     Unmount all volumes except server volumes and reboot.
  294.  ES
  295.     Exit the current application.
  296.  EA
  297.     Restart the current application.
  298.  WH [addr | trap#]
  299.     Find the name and addr of the parameter. If no parameter then
  300.     assume WH PC.
  301.  HOW
  302.     Display the reason MacsBug was entered this time.
  303.  F addr nbytes expr | 'string'
  304.     Search from addr to addr+nbytes-1 for the pattern. If pattern is
  305.     an expr then the width of the pattern is the smallest unit (byte,
  306.     word or long) that contains its value.
  307.  FB addr nbytes expr
  308.     Search from addr to addr+nbytes-1 for the byte.
  309.  FW addr nbytes expr
  310.     Search from addr to addr+nbytes-1 for the word.
  311.  FL addr nbytes expr
  312.     Search from addr to addr+nbytes-1 for the long.
  313.  FP addr nbytes expr
  314.     Search from addr to addr+nbytes-1 for the pointer.
  315.  CS [addr [addr]]
  316.     Checksum addr range and store the value. CS without parameters
  317.     checksums the last addr range and compares it to the last value.
  318.     If no second addr then checksum the long word at addr.
  319.  LOG [pathname | Printer]
  320.     Log all MacsBug output to a file or to an ImageWriter printer.
  321.     LOG without parameters turns logging off.
  322.  SHOW [addr | 'addr' [ L | LA | W | A ]]
  323.     Display memory at addr in status region. Quoting addr causes it
  324.     to be evaluated each time the display is updated. SHOW without
  325.     parameters cycles thru the display formats. The formats are
  326.       L:  Long words
  327.       LA: Combination of Longs and ASCII
  328.       W:  Words
  329.       A:  ASCII Text
  330.  
  331. Miscellaneous (cont.)
  332.  
  333.  SWAP
  334.     If you have a single screen then SWAP toggles between:
  335.       Drawing step and A-Trap trace info without swapping.
  336.       Draw step and A-Trap trace info and swap each time.
  337.     If you have multiple screens then SWAP toggles between:
  338.       MacsBug screen is always visible.
  339.       MacsBug screen is visible only at breaks.
  340.  DX [ON | OFF]
  341.     Turn user breaks (A9FF, ABFF) on or off. Toggle if no parameter.
  342.  DV
  343.     Display MacsBug version.
  344.  HELP [cmd | topic]
  345.     Display info about a specific command or topic. If no parameter
  346.     then display all topics.
  347.